#ifndef QTPRESETLISTVIEWER_H
#define QTPRESETLISTVIEWER_H

#include "IF_GuiLightControlPanel.h"
#include "QAbstractItemModel"

#include "ActionListView.h"

class QWidget;
class QListView;
class QAbstractItemModel;
class LightPresetPlaybar;
class LightPresetDelegate;

class QtLightControlPanel : public IF_GuiLightControlPanel
{
   Q_OBJECT
public:
   explicit QtLightControlPanel(int numberOfChannels, ActionListController &actionController,
                                QAbstractItemModel *model, QWidget *parent);

public slots:
   virtual void shiftFocusedUp();
   virtual void shiftFocusedDown();

   virtual void triggerActivePreset();

private:
   ActionListController & m_actionController;
   ActionListView *m_presetsView;
   LightPresetPlaybar *m_controlBar;
   QAbstractItemModel *m_presetModel;
   LightPresetDelegate *m_delegate;

private slots:
   void onPlayRequest();
   void onEditRequest();
   void onActiveChanged(int row);
   void updateControlBar();

private:
   void applyLevelsOfIndex(const QModelIndex &rowIndex);
};

#endif // QTPRESETLISTVIEWER_H
